import {  useLocation,useParams ,useNavigate} from 'react-router-dom'

const withRouter = (Cp)=>{
    const NewCp = (props)=>{
        const location = useLocation();
        const params = useParams();
        const navigate = useNavigate();
        return <Cp {...props} location={location} param={params}  navigate={navigate} />
    }
    return NewCp
}

export default withRouter;